import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '操作类型',
    align: "center",
    dataIndex: 'defectStatusOptTypeContent'
  },
  {
    title: '当前状态',
    align: "center",
    dataIndex: 'currentStatus_dictText'
  },
  {
    title: '当前状态',
    align: "center",
    dataIndex: 'currentStatusContent'
  },
  {
    title: '变更状态',
    align: "center",
    dataIndex: 'changeStatus_dictText'
  },
  {
    title: '变更状态',
    align: "center",
    dataIndex: 'changeStatusContent'
  },
  {
    title: '修改人',
    align: "center",
    dataIndex: 'changeOwner_dictText'
  },
  {
    title: '修改人角色',
    align: "center",
    dataIndex: 'changeOwnerRole'
  },
  {
    title: '指向人',
    align: "center",
    dataIndex: 'nextOwner_dictText'
  },
  {
    title: '指向人角色',
    align: "center",
    dataIndex: 'nextOwnerRole'
  },
  {
    title: '修改时间',
    align: "center",
    dataIndex: 'changeTime'
  },
  {
    title: '修改备注',
    align: "center",
    dataIndex: 'changeComment'
  },
  {
    title: '是否重新打开',
    align: "center",
    dataIndex: 'isReopen'
  },
  {
    title: '重新打开',
    align: "center",
    dataIndex: 'reopenContent'
  },
  {
    title: '重新打开次数',
    align: "center",
    dataIndex: 'reopenTimes'
  },
  {
    title: '影响范围',
    align: "center",
    dataIndex: 'infects'
  },
  {
    title: '不解决原因',
    align: "center",
    dataIndex: 'noSloveReason'
  },
  {
    title: '缺陷原因',
    align: "center",
    dataIndex: 'defectReason'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '操作类型',
    field: 'defectStatusOptType',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "defect_status_opt_type"
    },
  },
  {
    label: '当前状态',
    field: 'currentStatus',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "bug_status"
    },
  },
  {
    label: '当前状态',
    field: 'currentStatusContent',
    component: 'Input',
  },
  {
    label: '变更状态',
    field: 'changeStatus',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "bug_status"
    },
  },
  {
    label: '变更状态',
    field: 'changeStatusContent',
    component: 'Input',
  },
  {
    label: '修改人',
    field: 'changeOwner',
    component: 'JSelectUser',
    componentProps:{
      labelKey: 'realname',
    },
  },
  {
    label: '修改人角色',
    field: 'changeOwnerRole',
    component: 'Input',
  },
  {
    label: '指向人',
    field: 'nextOwner',
    component: 'JSelectUser',
    componentProps:{
      labelKey: 'realname',
    },
  },
  {
    label: '指向人角色',
    field: 'nextOwnerRole',
    component: 'Input',
  },
  {
    label: '修改时间',
    field: 'changeTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '修改备注',
    field: 'changeComment',
    component: 'Input',
  },
  {
    label: '是否重新打开',
    field: 'isReopen',
    component: 'Input',
  },
  {
    label: '重新打开',
    field: 'reopenContent',
    component: 'Input',
  },
  {
    label: '重新打开次数',
    field: 'reopenTimes',
    component: 'InputNumber',
  },
  {
    label: '影响范围',
    field: 'infects',
    component: 'Input',
  },
  {
    label: '不解决原因',
    field: 'noSloveReason',
    component: 'Input',
  },
  {
    label: '缺陷原因',
    field: 'defectReason',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  defectStatusOptTypeContent: {title: '操作类型',order: 1,view: 'text', type: 'string',},
  currentStatus: {title: '当前状态',order: 2,view: 'list', type: 'string',dictCode: 'bug_status',},
  currentStatusContent: {title: '当前状态',order: 3,view: 'text', type: 'string',},
  changeStatus: {title: '变更状态',order: 4,view: 'list', type: 'string',dictCode: 'bug_status',},
  changeStatusContent: {title: '变更状态',order: 5,view: 'text', type: 'string',},
  changeOwner: {title: '修改人',order: 6,view: 'sel_user', type: 'string',},
  changeOwnerRole: {title: '修改人角色',order: 7,view: 'text', type: 'string',},
  nextOwner: {title: '指向人',order: 8,view: 'sel_user', type: 'string',},
  nextOwnerRole: {title: '指向人角色',order: 9,view: 'text', type: 'string',},
  changeTime: {title: '修改时间',order: 10,view: 'datetime', type: 'string',},
  changeComment: {title: '修改备注',order: 11,view: 'text', type: 'string',},
  isReopen: {title: '是否重新打开',order: 12,view: 'text', type: 'string',},
  reopenContent: {title: '重新打开',order: 13,view: 'text', type: 'string',},
  reopenTimes: {title: '重新打开次数',order: 14,view: 'number', type: 'number',},
  infects: {title: '影响范围',order: 15,view: 'text', type: 'string',},
  noSloveReason: {title: '不解决原因',order: 16,view: 'text', type: 'string',},
  defectReason: {title: '缺陷原因',order: 17,view: 'text', type: 'string',},
};
